<template>
    <div>
        <el-input 
            v-show="isShow" 
            v-model="input" 
            placeholder="请输入"
            @focus="inputFocus"
        ></el-input>
        <el-input
            v-show="!isShow"
            type="textarea"
            :rows="3"
            placeholder="请输入"
            v-model="input"
            ref='textareaItem'
            @blur="inputBlur"
            @change="inputBlur"
        ></el-input>
    </div>
</template>
<script>
export default {
    data(){
        return{
            isShow:true,
            input:'',
        }
    },
    methods:{
        inputFocus(){
            this.isShow=false;
            this.$nextTick(()=>{
                this.$refs.textareaItem.$el.children[0].focus()
            })
        },
        inputBlur(){
            this.isShow=true;
            this.$emit('backContentFn',this.input)
        },
        clearInput(){
            this.input="";
        },
    }
}
</script>
